package psychoproject

//Esta vista extrae los valores de la pregunta aun no tiene formato.
class ViewQuestionController {

    def index = {
        redirect(action: "viewquest")
    }
    def viewquest ={
        def questions = Question.list().last()
        def text= questions.questionText
        def ans1= questions.answer1
        def ans2= questions.answer2
        def state= questions.state
        def letra= questions.type
        [questions:questions,text:text,ans1:ans1,ans2:ans2,state:state,letra:letra]
    
        }
        def auth() {
        if(!session.user) {
            redirect(controller:"Security", action:"login")
            return false
        }
    }
}
